﻿<%@ Page Language="C#" MasterPageFile="~/masterPage/front/basePage.master" AutoEventWireup="true" CodeFile="NewsList.aspx.cs" 
    Inherits="NewsList" Title="联系我们---零件资源网" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register src="~/controls/common/NewsCategy.ascx" tagname="NewsCategory" tagprefix="SalePartial" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

        <!--
        <div id="newnews" class="commonfrm">
            <h4>最新新闻</h4>
            <table  border="0" cellpadding="0" cellspacing="0" width="96%">
            <tr>
                <th  class="td_category">所属类别</th>
                <th class="td_title">新闻标题</th>
                <th>发布时间</th>
             </tr>
                <asp:Repeater ID="rptNewNews" runat="server">
                    <ItemTemplate>
                    <tr>
                        <td class="td_category"><a href='list.aspx?caid=<%#Eval("caid")%>'><%#Eval("name")%></a></td>
                        <td class="td_title"><a href="newscontent.aspx?id=<%#Eval("id")%>" title='<%#Eval("title")%>' target="_blank"><%#SalePartial.Utility.Utils.StringTruncate(Eval("title").ToString(), 20, "...")%></a></td>
                        <td><%#Eval("createtime","{0:yyyy-MM-dd}")%></td>
                    </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
        </div>
        -->
        <!--热点新闻-->
        
            <h4>热点新闻</h4>

                  <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
                <asp:ListView ID="repCatagory" runat="server" DataKeyNames="CaID" DataSourceID="SqlDataSource1">
                    <ItemTemplate>
                        <tr style="background: #fff; font: 12px/16px segoe ui; line-height: 25px;">
                            <td>
                                <asp:Label ID="CaNameLabel" runat="server" Text='<%# Eval("CaName") %>'></asp:Label>
                            </td>
                            <td width="60%">
                                <asp:LinkButton ID="btnLink" runat="server" Text='<%# Eval("Title") %>' CommandArgument='<%#Eval("NewsID")%>' OnClick="LbtnLink_Click"></asp:LinkButton>
                            </td>
                            <td>
                                <asp:Label ID="CreateDateLabel" runat="server" Text='<%# Eval("CreateDate") %>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label ID="CreateUserLabel" runat="server" Text='<%# SalePartial.Utility.Utils.StringTruncate(Eval("UserName").ToString(), 10, "...") %>'></asp:Label>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <AlternatingItemTemplate>
                        <tr style="background: #EDEDED; font: 12px/16px segoe ui; line-height: 25px;">
                            <td>
                                <asp:Label ID="CaNameLabel" runat="server" Text='<%# Eval("CaName") %>'></asp:Label>
                            </td>
                            <td width="60%">
                                <asp:LinkButton ID="btnLink" runat="server" Text='<%# Eval("Title") %>' CommandArgument='<%#Eval("NewsID")%>' OnClick="LbtnLink_Click"></asp:LinkButton>
                            </td>
                            <td>
                                <asp:Label ID="CreateDateLabel" runat="server" Text='<%# Eval("CreateDate") %>'></asp:Label>
                            </td>
                            <td>
                                <asp:Label ID="CreateUserLabel" runat="server" Text='<%# SalePartial.Utility.Utils.StringTruncate(Eval("UserName").ToString(), 10, "...") %>'></asp:Label>
                            </td>
                        </tr>
                    </AlternatingItemTemplate>
                  
                    <EmptyDataTemplate>
                        <table id="Table1" runat="server" style="">
                            <tr>
                                <td>
                                    没有新闻数据.
                                </td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                    <LayoutTemplate>
                        <table id="Table2" runat="server" cellpadding="0" cellspacing="0" style="border: 1px solid #C3C3C3;
                            width: 100%;">
                            <tr id="Tr1" runat="server">
                                <td id="Td1" runat="server">
                                    <table id="itemPlaceholderContainer" runat="server" border="0" style="font: 12px/16px segoe ui;
                                        width: 100%;" cellspacing="0">
                                        <tr id="Tr2" runat="server" style="background: #EDEDED; line-height: 25px;">
                                            <th id="Th1" runat="server" style="text-align: left; font-weight: normal;">
                                                所属类别
                                            </th>
                                            <th id="Th2" runat="server" style="text-align: left; font-weight: normal;">
                                                新闻标题
                                            </th>
                                            <th id="Th3" runat="server" style="text-align: left; font-weight: normal;">
                                                发布时间
                                            </th>
                                            <th id="Th4" runat="server" style="text-align: left; font-weight: normal;">
                                                发布者
                                            </th>
                                        </tr>
                                        <tr id="itemPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tfoot>
                                <tr>
                                    <td colspan="5">
                                        <telerik:RadDataPager ID="RadDataPagerProducts" runat="server" PagedControlID="repCatagory"
                                            PageSize="5" Skin="Metro"  EnableEmbeddedSkins="false">
                                            <Fields>
                                                <telerik:RadDataPagerButtonField FieldType="FirstPrev"></telerik:RadDataPagerButtonField>
                                                <telerik:RadDataPagerButtonField FieldType="Numeric"></telerik:RadDataPagerButtonField>
                                                <telerik:RadDataPagerButtonField FieldType="NextLast"></telerik:RadDataPagerButtonField>
                                            </Fields>
                                        </telerik:RadDataPager>
                                    </td>
                                </tr>
                            </tfoot>
                        </table>
                    </LayoutTemplate>
                </asp:ListView>
            </telerik:RadAjaxPanel>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Metro" EnableEmbeddedSkins="false">
            </telerik:RadAjaxLoadingPanel>

   <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>"
        SelectCommand="SELECT  N.CaID, N.NewsID,G.CaName, N.Title,N.CreateDate, U.UserName FROM [XPNewsCateGory] G,[XPNews] N,  aspnet_Users U WHERE  N.CreateUserID = U.UserId  AND G.CaID = N.CaID ORDER BY  N.CreateDate DESC" >
    </asp:SqlDataSource>
</asp:Content>
